package com.gxa.learning.core.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 证书实体类
 *
 * @Author ChenJ
 * @date 2021/12/02 14:20
 **/
@AllArgsConstructor
@NoArgsConstructor
@Data
@Table(name = "tb_certificate")
@ApiModel
public class Certificate implements Serializable {

    /**
     * 证书编号
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "certificate_id")
    @ApiModelProperty(name = "id", value = "证书编号", dataType = "Long", example = "1")
    private Long id;

    /**
     * 证书名称
     */
    @Column(name = "certificate_name", unique = true)
    @ApiModelProperty(name = "name", value = "证书名称", dataType = "String", example = "名称")
    private String name;

    /**
     * 证书ID 用uuid生成
     */
    @Column(name = "certificate_uuid", unique = true)
    @ApiModelProperty(name = "uuid", value = "uuid", dataType = "String", example = "证书ID")
    private String uuid;

    /**
     * 证书类型
     */
    @Column(name = "certificate_type", unique = true)
    @ApiModelProperty(name = "type", value = "type", dataType = "String", example = "证书类型")
    private String type;

    /**
     * 证书上传人
     */
    @Column(name = "certificate_user", unique = true)
    @ApiModelProperty(name = "user", value = "user", dataType = "String", example = "证书上传人")
    private String user;

    /**
     * 证书状态 true：上架 false 下架
     */
    @Column(name = "certificate_status", unique = true)
    @ApiModelProperty(name = "status", value = "status", dataType = "Boolean", example = "证书状态 true：上架 false 下架")
    private Boolean status;

    /**
     * 证书上传时间
     */
    @Column(name = "certificate_time")
    @ApiModelProperty(name = "time", value = "time", dataType = "Date", example = "证书上传时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date time;

    /**
     * 证书内容 证书的描述
     */
    @Column(name = "certificate_content", unique = true)
    @ApiModelProperty(name = "content", value = "content", dataType = "String", example = "证书内容 证书的描述")
    private String content;

    /**
     * 证书背景 证书的图片
     */
    @Column(name = "certificate_img", unique = true)
    @ApiModelProperty(name = "img", value = "img", dataType = "String", example = "证书背景 证书的图片")
    private String img;

    /**
     * 发证机构
     */
    @Column(name = "certificate_org", unique = true)
    @ApiModelProperty(name = "org", value = "org", dataType = "String", example = "发证机构")
    private String org;

}
